package com.book.oauth.server.dept.hystrix.impl;

import com.book.common.api.impl.BaseHystrixImpl;
import com.book.oauth.server.dept.dto.DeptDto;
import com.book.oauth.server.dept.vo.DeptVo;
import com.book.oauth.server.dept.hystrix.IDeptHystrix;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * Description：部门 HystrixImpl
 * @Author： leo
 * @CreateDate： 2020-12-31
 * @Email： leo.xiong@suyun360.com
 * Version: 1.0
 */
@Slf4j
@Component
public class DeptHystrixImpl extends BaseHystrixImpl<DeptDto, DeptVo> implements FallbackFactory<IDeptHystrix>, IDeptHystrix {

    @Override
    public IDeptHystrix create(Throwable e) {
        log.error("oauth-server.DeptHystrixImpl.部门服务调用失败:{}", e.getMessage());
        e.printStackTrace();
        return new DeptHystrixImpl();
    }
}
